package demo4.pojo;

/**
 * 设计一个User类，用它的每一个对象表示一个用户信息
 * 对应的就是tedu库中user表
 */
public class User {
    private Integer id;//对于基本类型值时，应当改为包装类，可以将数据库中的null值转化为0
    private String username;
    private String password;
    private String nickname;
    private Integer age;
    public User(){}
    public User(Integer id,String username,String password,String nickname,Integer age){
        this.id=id;
        this.username=username;
        this.nickname=nickname;
        this.password=password;
        this.age=age;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", age=" + age +
                '}';
    }
}
